@use './variables.scss' as *;

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #app {
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  overflow-x: hidden;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: $font-size-base;
  color: $text-primary;
  background-color: $background-color;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 通用样式类
.container, .landing-container, .home-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

// 文本溢出省略
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

// 响应式工具类
@media screen and (max-width: $breakpoint-sm) {
  .hidden-sm {
    display: none !important;
  }
}

@media screen and (max-width: $breakpoint-md) {
  .hidden-md {
    display: none !important;
  }
}

// 动画
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: $background-color;
  border-radius: $border-radius-base;
}

::-webkit-scrollbar-thumb {
  background: $text-secondary;
  border-radius: $border-radius-base;
  
  &:hover {
    background: $text-regular;
  }
}

// 链接样式
a {
  color: $primary-color;
  text-decoration: none;
  
  &:hover {
    color: $primary-color-light;
  }
}

// 清除浮动
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

// 多行文本溢出省略
.multi-ellipsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

// 响应式布局
@media screen and (max-width: $breakpoint-sm) {
  .container {
    padding: 0 $spacing-small;
  }
}

#app {
  font-weight: normal;
}

a,
.green {
  text-decoration: none;
  color: hsla(160, 100%, 37%, 1);
  transition: 0.4s;
  padding: 3px;
}

@media (hover: hover) {
  a:hover {
    background-color: hsla(160, 100%, 37%, 0.2);
  }
}

@media (min-width: 1024px) {
  /* body {
    display: flex;
    place-items: center;
  }

  #app {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 2rem;
  } */
} 